<!doctype html>
<html> 
 <head> 
  <meta charset="utf-8"> 
  <title>Layui 徽章文档</title> 
  <meta name="renderer" content="webkit"> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 
  <meta name="apple-mobile-web-app-status-bar-style" content="black"> 
  <meta name="apple-mobile-web-app-capable" content="yes"> 
  <meta name="format-detection" content="telephone=no"> 
  <link rel="stylesheet" href="/layui/dist/css/layui.css" media="all"> 
  <link rel="stylesheet" href="/static/css/global.css" media="all"> 
 </head> 
 <body> 
  <div class="layui-header header header-doc"> 
   <div class="layui-container"> <a class="logo" href="/index.html"> <img src="/static/images/layui/logo.png" alt="layui"> </a> 
    <div class="layui-form layui-hide-xs component" lay-filter="LAY-site-header-component"></div> 
    <div class="layui-hide-xs site-notice"></div> 
    <ul class="layui-nav" id="LAY_NAV_TOP"> 
     <li class="layui-nav-item layui-this"> <a href="/doc/index.html">文档</a> </li> 
     <li class="layui-nav-item "> <a href="/demo/index.html">示例</a> </li> 
     <li class="layui-nav-item"> <a href="javascript:;"> <!--<span class="layui-badge-dot" style="left:0; right: auto; margin: -4px 0 0 5px;"></span>--> 周边 </a> 
      <dl class="layui-nav-child layui-nav-child-c"> 
       <dd class="layui-hide-sm layui-show-xs" lay-unselect> <a href="https://gitee.com/sentsin/layui/issues" target="_blank" rel="nofollow">问题反馈</a> 
        <hr> 
       </dd> 
       <dd lay-unselect>
        <a href="/alone.html" target="_blank" lay-unselect>独立组件</a>
       </dd> 
       <dd lay-unselect>
        <a href="/extend/" target="_blank">扩展组件</a>
       </dd> 
      </dl> </li> 
     <li class="layui-nav-item layui-hide-xs"> <a href="//gitee.com/sentsin/layui/issues" target="_blank" rel="nofollow">反馈</a> </li> 
    </ul> 
   </div> 
  </div> <!-- 让IE8/9支持媒体查询，从而兼容栅格 --> <!--[if lt IE 9]>
  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]--> 
  <ul class="site-dir"> 
   <li><a href="#use"><cite>快速使用</cite></a></li> 
   <li><a href="#mod"><cite>与其它元素的搭配</cite></a></li> 
  </ul> 
  <div class="layui-container layui-row"> 
   <div class="layui-col-md3"> 
    <div class="layui-panel site-menu"> 
     <ul class="layui-menu layui-menu-lg"> 
      <li class="layui-menu-item-group" lay-options="{type: 'group', isAllowSpread: true}"> 
       <div class="layui-menu-body-title">
         基础说明 
       </div> 
       <hr> 
       <ul> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/index.html"> <span>开始使用 </span> <span class="layui-font-12 layui-font-gray">Getting Started</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/base/infrastructure.html"> <span>底层方法 </span> <span class="layui-font-12 layui-font-gray">基础支撑</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/base/element.html"> <span>页面元素 </span> <span class="layui-font-12 layui-font-gray">规范 公共类 属性</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/base/modules.html"> <span>模块规范 </span> <span class="layui-font-12 layui-font-gray">使用 扩展</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/base/faq.html"> <span>常见问题 </span> <span class="layui-font-12 layui-font-gray">FAQ</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/base/changelog.html"> <span>更新日志 </span> <span class="layui-font-12 layui-font-gray">changelog</span> <span class="layui-badge-dot"></span> </a> 
         </div> </li> 
       </ul> </li> 
      <li class="layui-menu-item-group" lay-options="{type: 'group', isAllowSpread: true}"> 
       <div class="layui-menu-body-title">
         页面元素 
       </div> 
       <hr> 
       <ul> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/layout.html"> <span>布局 </span> <span class="layui-font-12 layui-font-gray">栅格 后台管理布局</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/color.html"> <span>颜色 </span> <span class="layui-font-12 layui-font-gray">主色调 颜色搭配</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/icon.html"> <span>图标 </span> <span class="layui-font-12 layui-font-gray">iconfont 字体图标</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/anim.html"> <span>动画 </span> <span class="layui-font-12 layui-font-gray">内置 CSS3 动画</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/button.html"> <span>按钮 </span> <span class="layui-font-12 layui-font-gray">button</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/form.html"> <span>表单 </span> <span class="layui-font-12 layui-font-gray">form 元素集合</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/nav.html"> <span>导航 </span> <span class="layui-font-12 layui-font-gray">nav 面包屑</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/menu.html"> <span>菜单 </span> <span class="layui-font-12 layui-font-gray">menu 基础菜单</span> <span class="layui-badge-dot"></span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/tab.html"> <span>选项卡 </span> <span class="layui-font-12 layui-font-gray">Tabs 切换</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/progress.html"> <span>进度条 </span> <span class="layui-font-12 layui-font-gray">progress</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/panel.html"> <span>面板 </span> <span class="layui-font-12 layui-font-gray">panel 卡片 折叠</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/table.html"> <span>表格 </span> <span class="layui-font-12 layui-font-gray">静态 table</span> </a> 
         </div> </li> 
        <li class="layui-menu-item-checked2"> 
         <div class="layui-menu-body-title"> <a href="/doc/element/badge.html"> <span>徽章 </span> <span class="layui-font-12 layui-font-gray">小圆点 小边框</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/timeline.html"> <span>时间线 </span> <span class="layui-font-12 layui-font-gray">timeline</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/element/auxiliar.html"> <span>辅助 </span> <span class="layui-font-12 layui-font-gray">引用 字段集 横线等</span> </a> 
         </div> </li> 
       </ul> </li> 
      <li class="layui-menu-item-group" lay-options="{type: 'group', isAllowSpread: true}"> 
       <div class="layui-menu-body-title">
         内置模块 
       </div> 
       <hr> 
       <ul> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/layer.html"> <span>弹出层 </span> <span class="layui-font-12 layui-font-gray">layer</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/laydate.html"> <span>日期与时间选择 </span> <span class="layui-font-12 layui-font-gray">laydate</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/laypage.html"> <span>分页 </span> <span class="layui-font-12 layui-font-gray">laypage</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/laytpl.html"> <span>模板引擎 </span> <span class="layui-font-12 layui-font-gray">laytpl</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/table.html"> <span>数据表格 </span> <span class="layui-font-12 layui-font-gray">table</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/form.html"> <span>表单 </span> <span class="layui-font-12 layui-font-gray">form</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/upload.html"> <span>文件上传 </span> <span class="layui-font-12 layui-font-gray">upload</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/dropdown.html"> <span>下拉菜单 </span> <span class="layui-font-12 layui-font-gray">dropdown</span> <span class="layui-badge-dot"></span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/transfer.html"> <span>穿梭框 </span> <span class="layui-font-12 layui-font-gray">transfer</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/tree.html"> <span>树形组件 </span> <span class="layui-font-12 layui-font-gray">tree</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/colorpicker.html"> <span>颜色选择器 </span> <span class="layui-font-12 layui-font-gray">colorpicker</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/element.html"> <span>常用元素操作 </span> <span class="layui-font-12 layui-font-gray">element</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/slider.html"> <span>滑块 </span> <span class="layui-font-12 layui-font-gray">slider</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/rate.html"> <span>评分 </span> <span class="layui-font-12 layui-font-gray">rate</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/carousel.html"> <span>轮播 </span> <span class="layui-font-12 layui-font-gray">carousel</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/flow.html"> <span>流加载 </span> <span class="layui-font-12 layui-font-gray">flow</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/util.html"> <span>工具组件 </span> <span class="layui-font-12 layui-font-gray">util</span> </a> 
         </div> </li> 
        <li class=""> 
         <div class="layui-menu-body-title"> <a href="/doc/modules/code.html"> <span>代码高亮显示 </span> <span class="layui-font-12 layui-font-gray">code</span> </a> 
         </div> </li> 
       </ul> </li> 
     </ul> 
    </div> 
    <div class="layui-hide-v">
      - 
    </div> 
   </div> 
   <div class="layui-col-md9 site-content"> 
    <h1 class="site-h1">徽章</h1> 
    <blockquote class="layui-elem-quote">
      徽章是一个修饰性的元素，它们本身细小而并不显眼，但掺杂在其它元素中就显得尤为突出了。页面往往因徽章的陪衬，而显得十分和谐。 
    </blockquote> 
    <fieldset class="layui-elem-field layui-field-title site-title"> <legend><a name="use">快速使用</a></legend> 
    </fieldset> 
    <div class="site-text"> 
     <p>不妨先来看看 徽章 这个小小的大家族吧：</p> 
     <blockquote class="layui-elem-quote layui-quote-nm"> <span class="layui-badge-dot"></span> <span class="layui-badge-dot layui-bg-orange"></span> <span class="layui-badge-dot layui-bg-green"></span> <span class="layui-badge-dot layui-bg-cyan"></span> <span class="layui-badge-dot layui-bg-blue"></span> <span class="layui-badge-dot layui-bg-black"></span> <span class="layui-badge-dot layui-bg-gray"></span> <span class="layui-badge">6</span> <span class="layui-badge">99</span> <span class="layui-badge">61728</span> <span class="layui-badge">赤</span> <span class="layui-badge layui-bg-orange">橙</span> <span class="layui-badge layui-bg-green">绿</span> <span class="layui-badge layui-bg-cyan">青</span> <span class="layui-badge layui-bg-blue">蓝</span> <span class="layui-badge layui-bg-black">黑</span> <span class="layui-badge layui-bg-gray">灰</span> <span class="layui-badge-rim">6</span> <span class="layui-badge-rim">Hot</span> 
     </blockquote> 
     <br> 
     <p>你可能已经敏锐地发现，除去花枝招展的七种颜色，徽章具有三种不同的风格类型：<em>小圆点</em>、<em>椭圆体</em>、<em>边框体</em></p> 
     <pre class="layui-code">      
小圆点，通过 <span class="layui-badge-rim">layui-badge-dot</span> 来定义，里面不能加文字
&lt;span class="layui-badge-dot"&gt;&lt;/span&gt;
&lt;span class="layui-badge-dot layui-bg-orange"&gt;&lt;/span&gt;
&lt;span class="layui-badge-dot layui-bg-green"&gt;&lt;/span&gt;
&lt;span class="layui-badge-dot layui-bg-cyan"&gt;&lt;/span&gt;
&lt;span class="layui-badge-dot layui-bg-blue"&gt;&lt;/span&gt;
&lt;span class="layui-badge-dot layui-bg-black"&gt;&lt;/span&gt;
&lt;span class="layui-badge-dot layui-bg-gray"&gt;&lt;/span&gt;
 
椭圆体，通过 <span class="layui-badge-rim">layui-badge</span> 来定义。事实上我们把这个视作为主要使用方式
&lt;span class="layui-badge"&gt;6&lt;/span&gt;
&lt;span class="layui-badge"&gt;99&lt;/span&gt;
&lt;span class="layui-badge"&gt;61728&lt;/span&gt;
 
&lt;span class="layui-badge"&gt;赤&lt;/span&gt;
&lt;span class="layui-badge layui-bg-orange"&gt;橙&lt;/span&gt;
&lt;span class="layui-badge layui-bg-green"&gt;绿&lt;/span&gt;
&lt;span class="layui-badge layui-bg-cyan"&gt;青&lt;/span&gt;
&lt;span class="layui-badge layui-bg-blue"&gt;蓝&lt;/span&gt;
&lt;span class="layui-badge layui-bg-black"&gt;黑&lt;/span&gt;
&lt;span class="layui-badge layui-bg-gray"&gt;灰&lt;/span&gt;
 
边框体，通过 <span class="layui-badge-rim">layui-badge-rim</span> 来定义
&lt;span class="layui-badge-rim"&gt;6&lt;/span&gt;
&lt;span class="layui-badge-rim"&gt;Hot&lt;/span&gt;
      </pre> 
     <p></p> 
    </div> 
    <fieldset class="layui-elem-field layui-field-title site-title"> <legend><a name="mod">与其它元素的搭配</a></legend> 
    </fieldset> 
    <div class="site-text"> 
     <p>徽章主要是修饰作用，因此必不可少要与几乎所有的元素搭配。我们目前对以下元素内置了徽章的排版支持：</p> 
     <br>
     <p>按钮</p>
     <hr> 
     <p> <button class="layui-btn">查看消息<span class="layui-badge layui-bg-gray">6</span></button> <button class="layui-btn">动态<span class="layui-badge-dot layui-bg-orange"></span></button> <em> ← 快看！这颜色屎黄屎黄的。。。</em> </p> 
     <pre class="layui-code">&lt;button class="layui-btn"&gt;查看消息&lt;span class="layui-badge layui-bg-gray"&gt;1&lt;/span&gt;&lt;/button&gt;
&lt;button class="layui-btn"&gt;动态&lt;span class="layui-badge-dot layui-bg-orange"&gt;&lt;/span&gt;&lt;/button&gt;
      </pre> 
     <br>
     <p>导航</p>
     <hr> 
     <ul class="layui-nav" style="text-align: right;"> 
      <li class="layui-nav-item"> <a href="">控制台<span class="layui-badge">9</span></a> </li> 
      <li class="layui-nav-item"> <a href="">个人中心<span class="layui-badge-dot"></span></a> </li> 
     </ul> 
     <pre class="layui-code">&lt;ul class="layui-nav" style="text-align: right;"&gt; &lt;-- 小Tips：这里有没有发现，设置导航靠右对齐（或居中对齐）其实非常简单 --&gt;
  &lt;li class="layui-nav-item"&gt;
    &lt;a href=""&gt;控制台&lt;span class="layui-badge"&gt;9&lt;/span&gt;&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class="layui-nav-item"&gt;
    &lt;a href=""&gt;个人中心&lt;span class="layui-badge-dot"&gt;&lt;/span&gt;&lt;/a&gt;
  &lt;/li&gt;
&lt;/ul&gt;
      </pre> 
     <br>
     <p>选项卡（所有风格都支持，这里以简约风格为例）</p>
     <hr> 
     <div class="layui-tab layui-tab-brief"> 
      <ul class="layui-tab-title"> 
       <li class="layui-this">网站设置</li> 
       <li>用户管理<span class="layui-badge-dot"></span></li> 
       <li>最新邮件<span class="layui-badge">99+</span></li> 
      </ul> 
      <div class="layui-tab-content"></div> 
     </div> 
     <pre class="layui-code">&lt;div class="layui-tab layui-tab-brief"&gt;
  &lt;ul class="layui-tab-title"&gt;
    &lt;li class="layui-this"&gt;网站设置&lt;/li&gt;
    &lt;li&gt;用户管理&lt;span class="layui-badge-dot"&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;最新邮件&lt;span class="layui-badge"&gt;99+&lt;/span&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;div class="layui-tab-content"&gt;&lt;/div&gt;
&lt;/div&gt;
      </pre> 
     <p><br>而至于与其它更多元素的搭配，就由你自由把控吧！</p> 
    </div> 
    <fieldset class="layui-elem-field layui-field-title site-title"> <legend><a name="docend">结语</a></legend> 
    </fieldset> 
    <div class="site-text"> 
     <p>其实，在与其它元素的搭配中，你要做的，无非就是合理运用这几点：<span class="layui-badge-rim">边距</span> <span class="layui-badge-rim">背景色</span>，徽章必然大显神威！</p> 
    </div> 
    <div class="layui-elem-quote"> 
     <p>layui - 在每一个细节中，用心与你沟通</p> 
    </div> 
   </div> 
  </div> 
  <div class="layui-footer footer footer-doc"> 
   <p> Copyright © 2021 <a href="/index.html">layui.itmtr.cn</a> MIT Licensed</p> 
   <p> </p>
  </div> 
  <script>
window.global = {
  pageType: 'doc'
  ,preview: function(){
    var preview = document.getElementById('LAY_preview');
    return preview ? preview.innerHTML : '';
  }()
};
</script> 
  <div class="site-tree-mobile layui-hide"> <i class="layui-icon layui-icon-spread-left"></i> 
  </div> 
  <div class="site-mobile-shade"></div> 
  <script src="/layui/dist/layui.js" charset="utf-8"></script> 
  <script>
layui.config({
  base: '/static/lay/modules/layui/'
  ,version: '1632659138211'
}).use('global');
</script>  
 </body>
<script src="/common/common.js"></script>
</html>